package com.jeeplus.modules.report.service;    /**
 * @title: ReportTestService
 * @projectName jeeplus
 * @description: TODO
 * @author Administrator
 * @date 2019/8/1310:21
 */

import com.jeeplus.common.utils.DbUtils;
import com.jeeplus.common.utils.SqlUtils;
import com.jeeplus.modules.tools.utils.MultiDBUtils;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional(readOnly = true)
public class ReportTestService
        extends SqlUtils {
    public Map<String, Object> getSaleDiffList(int pageNo, int pageSize) throws IOException {
        String sql = "";
        Map<String, Object> map = new HashMap<String, Object>();
        sql = readScript(getClass(), "SaleDiff.sql");
        if (!sql.isEmpty()) {
            map.put("rows", MultiDBUtils.get("RMS").queryList((new DbUtils()).getLimitString(sql, pageNo, pageSize), new Object[0]));
            map.put("total", MultiDBUtils.get("RMS").getJdbcTemplate().queryForObject((new DbUtils()).getCountString(sql), Integer.class));
        }


        return map;
    }
}
